home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4935 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.1 KB

  1. Path: frco.com!usenet
  2. From: Jadam@tcmail.frco.com (Jim Adam)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: dynamic memory allocation
  5. Date: 1 Feb 1996 18:48:29 GMT
  6. Organization: Fisher Rosemount Systems
  7. Message-ID: <4er1tt$jnm@rolaids.frco.com>
  8. References: <310ABD89.5537@gnomic.stanford.edu> <DM0G35.AKr@news.arco.com>
  9. NNTP-Posting-Host: primrose.frco.com
  10. Mime-Version: 1.0
  11. X-Newsreader: WinVN 0.93.11
  12.  
  13. In article <DM0G35.AKr@news.arco.com>, lasbfl says...
  14.  
  15. >Or you can pass a reference to a pointer:
  16. >    void allocfunc( void &*p, size_t n) { p = malloc( n ); }
  17.                         ^^^^^
  18.  
  19. Actually, I think it has to be:
  20.  
  21.   void *& p   // "POINTER REFERENCE"
  22.  
  23. rather than
  24.  
  25.   void &* p   //  COMPILER ERROR:  NOT ALLOWED
  26.  
  27. It's weird, but the operators appear in opposite order
  28. of the way you would normally pronounce them.  I guess,
  29. think of it as a pointer reference rather than a reference
  30. to a pointer?  --Just a carry-over from the C declaration
  31. syntax.  (We never noticed this before, because we would
  32. only have
  33.  
  34.   void ** p
  35.  
  36. and who cares if the second * was really the first * as
  37. far as the compiler was concerned???)
  38.  
  39. Jim
  40. Jadam@tcmail.frco.com
  41.  
  42.